package cn.itcast.nems.studentrecord.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class SuspendJournalVo {

    // 保存于表单头中信息

    private String id;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    private LocalDateTime createdDatetime;
    private String state;
    private String createdBy;
    private String createdByName;
    private String createdByAndName;
    private String suspendTypeName;

    private Integer targetClazzId;
    private String targetClazzName;
    private String targetClazzTypeId;

    private Integer targetClazzPrice;
    private String targetClazzSubjectId;
    private String targetClazzSubjectName;
    private String targetClazzCampusId;
    private String targetClazzCampusName;
    private String targetClazzModelId;
    private String targetClazzModelName;
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @JsonSerialize(using = LocalDateSerializer.class)
    @JsonDeserialize(using = LocalDateDeserializer.class)
    private LocalDate targetClazzInDate;

    private String remark;

    // 保存于表单行中信息

    private String originStudentRecordId;

    private Integer originClazzId;
    private String originClazzName;
    private String originClazzTypeId;
    private String originClazzAmountDueFormatted;       // 应交金额
    private Integer originClazzServiceDays;             // 应服务天数
    private Integer originClazzActualSettlementDays;    // 实际服务天数
    private String originClazzActualSettlementAmountFormatted;   // 实际课耗金额
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @JsonSerialize(using = LocalDateSerializer.class)
    @JsonDeserialize(using = LocalDateDeserializer.class)
    private LocalDate originClazzOutDate;
    private String reasonCode;
    private String reasonDescription;


    // 来自学籍
    private Integer studentId;
    private String studentNumber;
    private String studentName;
    private String paidAmountFormatted;            // 已交金额

    // 临时计算
    private String FreezeAmountFormatted;         // 冻结金额

    // 列表要用到
    private Boolean approvalable; // 我是否能审批
    private String formId;
    private Boolean specialFlag;

    private Integer category;

    private LocalDate originClazzGraduationDate;
    private LocalDate originClazzPredictionGraduationDate;

    private LocalDate targetClazzGraduationDate;

    private LocalDate targetClazzPredictionGraduationDate;
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @JsonSerialize(using = LocalDateSerializer.class)
    @JsonDeserialize(using = LocalDateDeserializer.class)
    private LocalDate originClazzInDate;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @JsonSerialize(using = LocalDateSerializer.class)
    @JsonDeserialize(using = LocalDateDeserializer.class)
    private LocalDate targetClazzStartDate;



    private Integer multiPaymentAccountFlag;
    private String originPaymentAccountCode;
    private String originPaymentAccountName;

    private Boolean targetClazzUpgradeable;
    private Boolean originClazzUpgradeable;
}
